function getusername(){
    var a=document.getElementById("username");
    if(a.value==""){
        // 根据id获取span元素，然后给span设置元素
        document.getElementById("span1").setAttribute("class","onError");
    }else{
        document.getElementById("span1").setAttribute("class","onSuccess");
    }
}

function getemail(){
    var b=document.getElementById("email").value;
    var reg =/^([a-zA-Z]|[0-9])+\@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/;
    if(reg.test(b)){
        document.getElementById("span2").setAttribute("class","onSuccess");
        // alert('正确')
    }else{
        document.getElementById("span2").setAttribute("class","onError");
        // alert('错误')
    }
}

function getsend(){
    var a=document.getElementById("username").value;
    var b=document.getElementById("email").value;
    if(a==""&&b==""){
        event.preventDefault();
        alert('提交失败');
    }else{
        alert('提交成功');
    }
}

function getres(){
    location.reload();
    
}